package Song.Han.day04.demo03;

import java.util.Random;
import java.util.Scanner;

/*
 * 题目：
 *   根据int变量，获取随机数，范围是[1,n]*/
public class Demo03Random {
    public static void main(String[] args) {
        Random r = new Random();
        System.out.println("请输入大于0的随机数范围：");
        int n = new Scanner(System.in).nextInt();

        for (int i = 0; i < 10; i++) {
            int num = r.nextInt(n) + 1;
            System.out.println(num);
        }
    }
}
